<template>
	<view>
	<view class="user-bg">
			<image  src="../../static/my1.jpg"></image>
	</view>
	<view class="top">
		  <cmd-nav-bar :fixed="false"   title="我的"  font-color="#fff" ></cmd-nav-bar>
		 <view class="avatar_img">
			 <image :src="user.userAvatarUrl"></image>
		 </view> 
		 
		 <view class="nickname">
			 <text>{{user.userNickName}}</text>
		 </view>
		 <view class="d-flex j-center mt-2">
			 <view>
				 UID: {{user.id}}
			 </view>
			<!-- <view class="ml-5">
			 			<text class="font-weight">绑定号码: </text>
						<text>13888990988</text>
			 </view> -->
		 </view>
		 
		 <view class="d-flex j-center mt-2 ">
			 <view class="score position-relative">
			 		<image src="../../static/my3.png"></image> 
					<text class="text1">{{user.integral}}</text>
			 </view>
			 <view  class="score position-relative">
			 		<image src="../../static/my2.png"></image>
					<text class="text2">0.00</text>
			 </view>
		 </view>
		 
		<view class="mx-5 mt-2">
			<view class="d-flex j-sb my-line">
				<view class="d-flex">
							 <image class="myicon" src="../../static/my7.png"></image>
							 <text class="ml-2">我的追剧</text>
				</view>
				<view>
							 <image class="right" src="../../static/right.png"></image>
				</view>
			</view>
			<view class="d-flex j-sb my-line mt-3">
				<view class="d-flex">
							 <image class="myicon" src="../../static/my6.png"></image>
							 <text class="ml-2">我的观看</text>
				</view>
				<view>
							 <image class="right" src="../../static/right.png"></image>
				</view>
			</view>
			<view class="d-flex j-sb my-line mt-3">
				<view class="d-flex">
							 <image class="myicon" src="../../static/my5.png"></image>
							 <text class="ml-2">收藏小程序</text>
				</view>
				<view>
							 <image class="right" src="../../static/right.png"></image>
				</view>
			</view>
			<view class="d-flex j-sb my-line mt-3">
				<view class="d-flex">
							 <image class="myicon" src="../../static/my4.png"></image>
							 <text class="ml-2">联系客服</text>
				</view>
				<view>
							 <image class="right" src="../../static/right.png"></image>
				</view>
			</view>
			
			
		</view>
		 
	  	 
		  
	</view>

	
 		 
			   
	</view>
		
</template>

<script>
	import {
		getUserInfo
	} from "@/common/api/user.js"
	export default {
		data() {
			return {
				user:{}
  			}
		},
		onShow() {
			 this.getUser()
		 }, 
		methods: {
			getUser(){
				getUserInfo({}).then(res => {
					if(res.code == 200){
						this.user = res.result
					}
				})	 
			},
			
			
			logout() {

				uni.showModal({
					title: '提示',
					content: '确认退出登陆？',
					success: function(res) {
						if (res.confirm) {
							uni.removeStorage({
								key: 'token',
								success(res) {
									uni.redirectTo({
										url: '/pages/login/login'
									})
								}
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});


			}
		}
	}
</script>


 
<style lang="scss" scoped>
	 .top{position: relative;op:0;z-index: 9;width: 100%}
	 .user-bg {position: absolute;z-index: 7;}
	 .user-bg image{width: 750rpx;height: 1334rpx;}
	 .avatar_img{position: relative;left: 295rpx;top:43rpx;}
	 .avatar_img image{width: 158rpx;height: 158rpx;border-radius: 50%;}
	 .nickname{margin-top: 47rpx;font-size: 46rpx;font-family: SourceHanSansCN;font-weight: bold;color: #000000;text-align: center;}
	  .score{text-align: center;}
	 .score image{width: 346rpx;height: 147rpx;}
	 .score text{font-size: 36rpx;font-family: PingFang SC;font-weight: 600;color: #FC773A;}
	 .score .text1{position: relative;top:-86rpx;}
	 .score .text2{position: relative;top:-80rpx;left: 20rpx;}
	 .myicon{width: 40rpx;height: 33rpx;}
	 .right{width: 12rpx;height: 18rpx;}
	 .my-line{border-bottom: 1px solid #F5F5F5;padding-bottom: 20rpx;}
</style> 